<?php
// $Id: MymenuController.php 644 2013-01-20 10:21:08Z tomqin@gmail.com $

/**
 * Part of the framework.
 *
 * @package     Controller
 * @version     1.0
 * @copyright   Copyright (C) 2010-2012 SupeFun.com Inc.
 * @author      TomQin <tomqin@gmail.com>
 * @license     http://www.supefun.com/license/
 */

class MymenuController extends MemberController
{
    public function indexAction() {
        $this->render('m_mymenu');
    }

    public function saveAction() {
        if(!get_request('submitform')){
            header('Location: /account.php?m=biz&c=mymenu');
        }

        $error = $this->check();

        if(!$error){
            $this->upfileManager = Base::getObject('service.manager.upfileManager');

            $this->upfileManager
                 ->setField('shop_id',    $this->shopId)
                 ->setField('filename',   get_request('filename'))
                 ->setField('memo',       get_request('memo'))
                 ->setField('create_uid', $this->userInfo['uid'])
                 ->setField('create_dt',  TIMESTAMP)
                 ->insertDb();
            $this->renderMessage('菜单上传成功，请等待审核');
        }else{
            $this->setVar('error', $error);
            $this->setVar('data', get_request());
            $this->render('m_mymenu');
        }
    }

    public function check(){
        return array();
    }
}
